<h1>模板字符串</h1>
<script>
    // 1.多行字符串(用var声明也行)
    let str = `Hey,
    can you stop angry now?`

    console.log(str)
    console.log("----------------------")

    // 2.字符串插入变量和表达式,变量名写在${}中,${}中可以放入JavaScript表达式
    let name = 'Mike'
    let age = 27

    let info = `My name is ${name}, I am ${age+1} years old next year.`
    console.log(info)
    console.log("---------------")

    // 3.字符串中调用函数
    function f(){
        return "have fun!"
    }

    let str2 = `Game start,${f()}`
    console.log(str2)
    console.log("---------------------")

    //声明对象简写
    const age1 = 12
    const name1 = "Amy"

    //传统
    const person1 = {age:age1,name:name1}
    console.log(person1)
    console.log('---------------')

    // ES6
    const person2 = {age1,name1}
    console.log(person2)
</script>